<template>
  <div class="details">
    <div class="return" @click="back">
      <span>返回上一级</span>
      <img src="@/assets/images/return_you.png" alt />
    </div>
    <h1>{{ title }}</h1>

    <div class="content" v-html="content"></div>
  </div>
</template>
<script>
import { honor_list, honor_visit } from "@/api/about.js";
export default {
  data() {
    return {
      content: "",
      title: ""
    };
  },
  mounted() {
    let id = this.$route.query.id;
    honor_visit({ id: id }).then(res => {
      if (this.$isMobile()) {
        this.content = this.$pxToRem(res.data.data.content);
      } else {
        this.content = res.data.data.content;
      }

      this.title = res.data.data.title;
    });
    // window.scrollTo(0,0)
    //  this.$router.afterEach((to, from, next) => {
    //     window.scrollTo(0, 0)
    // })
    try {
      document.getElementById("zh").scrollTop(0);
    } catch (e) {
      console.log(document.getElementById("zh"));
    }
  },
  methods: {
    back() {
      this.$router.go(-1); //返回上一层
    }
  }
};
</script>
<style scoped src="./sass/aboutUs.css"></style>
